package com.wmm.job3;

import java.util.HashMap;
import java.util.Scanner;
import java.util.Set;

public class JobThree {

    public static void main(String[] args) {

        HashMap<String, Integer> hash = new HashMap<String, Integer>();
        Scanner sc = new Scanner(System.in);
        String str = "";
        while (true){
            str = sc.next();
            if (str.equals("-1"))
            {
               break;
            }
            else {
                if (hash.containsKey(str)) {
                    hash.put(str, hash.get(str) + 1);
                } else {
                    hash.put(str, 1);
                }
            }
        }
        Set<String> ss = hash.keySet();
        for(String s : ss){
            System.out.println(s +"出现了" + hash.get(s) + "次");
        }
    }
}
